﻿<%
'注册插件
Call RegisterPlugin("RndArticle","ActivePlugin_RndArticle")

Function ActivePlugin_RndArticle() 

End Function

'安装插件
Function InstallPlugin_RndArticle()
	Call RndArticle_Add_Navbar()
End Function

'卸载插件
Function UnInstallPlugin_RndArticle()
	Call RndArticle_Del_Navbar
End Function

'添加到导航栏
Function RndArticle_Add_Navbar
	Call GetFunction()
	Dim tmpstr:tmpstr = Functions(FunctionMetas.GetValue("navbar")).Content
	If InStr(tmpstr,"乱弹")=0 or InStr(tmpstr,"RndArticle")=0 Then
		Functions(FunctionMetas.GetValue("navbar")).Content = tmpstr & "<li><a href=""<#ZC_BLOG_HOST#>zb_users/plugin/RndArticle/"" rel=""nofollow"">乱弹</a></li>"
		Functions(FunctionMetas.GetValue("navbar")).Save
	End If
	Call ClearGlobeCache
	Call LoadGlobeCache
End Function

'从导航栏删除
Function RndArticle_Del_Navbar
	Call GetFunction()
	Functions(FunctionMetas.GetValue("navbar")).Content=RemoveLibyUrl(Functions(FunctionMetas.GetValue("navbar")).Content,"<#ZC_BLOG_HOST#>zb_users/plugin/RndArticle/")
	Functions(FunctionMetas.GetValue("navbar")).Save
	Call ClearGlobeCache
	Call LoadGlobeCache
End Function
%>